<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<include file="./Home/Tpl/Admin/Common/cssjs.html" />
</head>
<body>
<style type="text/css">
	html{_overflow-y:scroll}
</style>
<div class="pad-10">
  <div class="content-menu ib-a blue line-x"> <a class="add fb" href="javascript:void(0)" onclick="javascript:openwinx('{:U("Content/add",array("catid"=>$catid))}','')"><em>添加内容</em></a> <a href="?g=Contents&m=Create_html&a=category&pagesize=30&dosubmit=1&modelid={$modelid}&catids[0]={$catid}&referer=<?=urlencode("?g=Contents&m=Content&a=classlist&catid=".$catid)?>">&nbsp;&nbsp;<em>更新[<b>{$catname}</b>]栏目</em></a></div>
  <div id="searchid" style="">
    <form name="searchform" action="" method="get" >
      <input type="hidden" value="Contents" name="g">
      <input type="hidden" value="Content" name="m">
      <input type="hidden" value="classlist" name="a">
      <input type="hidden" value="{$catid}" name="catid">
      <input type="hidden" value="0" name="steps">
      <input type="hidden" value="1" name="search">
      <table width="100%" cellspacing="0" class="search-form">
        <tbody>
          <tr>
            <td><div class="explain-col"> 添加时间：
                <link rel="stylesheet" type="text/css" href="{$Config.siteurl}statics/js/calendar/jscal2.css"/>
                <link rel="stylesheet" type="text/css" href="{$Config.siteurl}statics/js/calendar/border-radius.css"/>
                <link rel="stylesheet" type="text/css" href="{$Config.siteurl}statics/js/calendar/win2k.css"/>
                <script type="text/javascript" src="{$Config.siteurl}statics/js/calendar/calendar.js"></script> 
                <script type="text/javascript" src="{$Config.siteurl}statics/js/calendar/lang/en.js"></script>
                <input type="text" name="start_time" id="start_time" value="{$Think.get.start_time}" size="10" class="date" readonly>
                &nbsp;<script type="text/javascript">
			Calendar.setup({
			weekNumbers: false,
		    inputField : "start_time",
		    trigger    : "start_time",
		    dateFormat: "%Y-%m-%d",
		    showTime: false,
		    minuteStep: 1,
		    onSelect   : function() {this.hide();}
			});
        </script>- &nbsp;
                <input type="text" name="end_time" id="end_time" value="{$Think.get.end_time}" size="10" class="date" readonly>
                &nbsp;<script type="text/javascript">
			Calendar.setup({
			weekNumbers: false,
		    inputField : "end_time",
		    trigger    : "end_time",
		    dateFormat: "%Y-%m-%d",
		    showTime: false,
		    minuteStep: 1,
		    onSelect   : function() {this.hide();}
			});
        </script>
                <select name="posids">
                  <option value='' <if condition=" $posids == '' "> selected</if>>{$posids}全部</option>
                  <option value="1" <if condition=" $posids == 1 "> selected</if>>推荐</option>
                  <option value="2" <if condition=" $posids == 2 "> selected</if>>不推荐</option>
                </select>
                <select name="searchtype">
                  <option value='0' <if condition=" $searchtype == '0' "> selected</if>>标题</option>
                  <option value='1' <if condition=" $searchtype == '1' "> selected</if>>简介</option>
                  <option value='2' <if condition=" $searchtype == '2' "> selected</if>>用户名</option>
                  <option value='3' <if condition=" $searchtype == '3' "> selected</if>>ID</option>
                </select>
                <input name="keyword" type="text" value="{$Think.get.keyword}" class="input-text" />
                <input type="submit" name="search" class="button" value="搜索" />
              </div></td>
          </tr>
        </tbody>
      </table>
    </form>
  </div>
  <form name="myform" id="myform" action="" method="post" >
    <div class="table-list">
      <table width="100%">
        <thead>
          <tr>
            <th width="16"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"></th>
            <th width="37">排序</th>
            <th width="40">ID</th>
            <th>标题</th>
            <th width="40">点击量</th>
            <th width="70">发布人</th>
            <th width="118">更新时间</th>
            <th width="72">管理操作</th>
          </tr>
        </thead>
        <tbody>
        <volist name="Content" id="vo">
          <tr>
            <td align="center"><input class="inputcheckbox " name="ids[]" value="{$vo.id}" type="checkbox"></td>
            <td align='center'><input name='listorders[{$vo.id}]' type='text' size='3' value='{$vo.listorder}' class='input-text-c'></td>
            <td align='center' ><a href="{:U("Contents/Create_html/batch_show", array("catid"=>$vo['catid'] ,"steps"=>"0" ,"ids"=>$vo['id'])  )}" title="点击生成">{$vo.id}</a></td>
            <td><a href="{$vo.url}" target="_blank"><span style="" ><if condition=" $vo['status']==99 ">{$vo.title}<else/><font color="#FF0000">[未审核]</font> - {$vo.title}</if></span></a>
            <if condition=" $vo['thumb']!='' "> 
            <img src="{$Config.siteurl}statics/images/icon/small_img.gif" title="标题图片">
            </if>
            <if condition=" $vo['posids'] "> 
            <img src="{$Config.siteurl}statics/images/icon/small_elite.gif" title="推荐位">
            </if>
            <if condition=" $vo['islink'] "> 
            <img src="{$Config.siteurl}statics/images/icon/link.png" title="转向地址">
            </if>
            </td>
            <td align='center' ><?=hits("c-".$vo['catid']."-".$vo['id']);?></td>
            <td align='center'> {$vo.username}</td>
            <td align='center'>{$vo.updatetime|date="Y-m-d H:i:s",###}</td>
            <td align='center'><a href="javascript:;" onclick="javascript:openwinx('{:U("Contents/Content/edit",array("catid"=>$vo['catid'],"id"=>$vo['id']))}','')">修改</a> | <a href="javascript:view_comment('c-{$vo.catid}-{$vo.id}','{$vo.title}')">评论</a></td>
          </tr>
        </volist>
        </tbody>
      </table>
      <div class="btn">
        <label for="check_box">全选/取消</label>
        <input type="hidden" value="aEh2dK" name="pc_hash">
        <input type="button" class="button" value="排序" onclick="myform.action='?g=Contents&m=Content&a=listorder&dosubmit=1&catid={$catid}&steps=0';myform.submit();"/>
        <input type="button" class="button" value="删除" onclick="myform.action='?g=Contents&m=Content&a=delete&dosubmit=1&catid={$catid}&steps=0';return confirm_delete()"/>
        <input type="button" class="button" value="批量生成HTML" onclick="myform.action='?g=Contents&m=Create_html&a=batch_show&dosubmit=1&catid={$catid}&steps=0';myform.submit();"/>
        <input type="button" style="display:none" class="button" value="批量移动" onclick="myform.action='?g=Contents&m=Content&a=remove&catid={$catid}';myform.submit();"/>
      </div>
      <div id="pages">{$Page}</div>
    </div>
  </form>
</div>
<script language="javascript" type="text/javascript" src="{$Config.siteurl}statics/js/cookie.js"></script> 
<script type="text/javascript"> 
<!--
function push() {
    var str = 0;
    var id = tag = '';
    $("input[name='ids[]']").each(function () {
        if ($(this).attr('checked') == true) {
            str = 1;
            id += tag + $(this).val();
            tag = '|';
        }
    });
    if (str == 0) {
        alert('您没有勾选信息');
        return false;
    }
    window.top.art.dialog({
        id: 'push'
    }).close();
    window.top.art.dialog({
        title: '推送：',
        id: 'push',
        iframe: '?m=content&c=push&action=position_list&catid=9&modelid=1&id=' + id,
        width: '800',
        height: '500'
    }, function () {
        var d = window.top.art.dialog({
            id: 'push'
        }).data.iframe; // 使用内置接口获取iframe对象
        var form = d.document.getElementById('dosubmit');
        form.click();
        return false;
    }, function () {
        window.top.art.dialog({
            id: 'push'
        }).close()
    });
}

function confirm_delete() {
    if (confirm('确认删除吗？')) $('#myform').submit();
}

function view_comment(id, name) {
	art.dialog.open("{$Config.siteurl}index.php?g=Comments&m=Comments&a=index&searchtype=2&keyword="+id,{
		 title: '查看评论：' + name,
		id: 'view_comment',
		width: '800px',
		height: '500px',
		ok:function(){
			return true;
		}
	});
}

function reject_check(type) {
    if (type == 1) {
        var str = 0;
        $("input[name='ids[]']").each(function () {
            if ($(this).attr('checked') == true) {
                str = 1;
            }
        });
        if (str == 0) {
            alert('您没有勾选信息');
            return false;
        }
        document.getElementById('myform').action = '?m=content&c=content&a=pass&catid=9&steps=0&reject=1';
        document.getElementById('myform').submit();
    } else {
        $('#reject_content').css('display', '');
        return false;
    }
}
setcookie('refersh_time', 0);

function refersh_window() {
    var refersh_time = getcookie('refersh_time');
    if (refersh_time == 1) {
        window.location.reload();
    }
}
setInterval("refersh_window()", 3000);
//-->
</script>
</body>
</html>